package com.quartz.example;

import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SimpleTrigger;
import org.quartz.impl.StdSchedulerFactory;

import java.util.Date;

import static org.quartz.TriggerBuilder.newTrigger;

public class SimpleTriggerOne {
    public static void main(String[] args) throws  Exception{
        Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();

//        SimpleTrigger simpleTrigger = (SimpleTrigger) newTrigger()
//                .withIdentity("操你妈")
//                .startAt(new Date())
//                .endAt(new Date())
//                .usingJobData("操你妈","100次")
//                .forJob("操你妈")
//                .build();

        SimpleTrigger trigger = (SimpleTrigger) newTrigger()
                .withIdentity("trigger1")
                .startAt(new  Date())
                .usingJobData("one","one-一拳超人")// some Date
                         // identify job with name, group strings
                .build();
        scheduler.scheduleJob(trigger);
        scheduler.start();

    }
}
